<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="DossierMedicalEditDlg" widgetVar="DossierMedicalEditDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.EditDossierMedicalTitle}">

            <h:form id="DossierMedicalEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{dossierMedicalController.selected != null}">

                        <h:outputLabel value="#{bundle.EditDossierMedicalLabel_idDossier}" for="idDossier" />
                        <h:outputText id="idDossier" value="#{dossierMedicalController.selected.idDossier}" />

                        <p:outputLabel value="#{bundle.EditDossierMedicalLabel_identite}" for="identite" />
                        <p:inputTextarea rows="4" cols="30" id="identite" value="#{dossierMedicalController.selected.identite}" title="#{bundle.EditDossierMedicalTitle_identite}" />

                        <p:outputLabel value="#{bundle.EditDossierMedicalLabel_dateDossier}" for="dateDossier" />
                        <p:calendar id="dateDossier" pattern="MM/dd/yyyy" value="#{dossierMedicalController.selected.dateDossier}" title="#{bundle.EditDossierMedicalTitle_dateDossier}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.EditDossierMedicalLabel_histoireMaladie}" for="histoireMaladie" />
                        <p:inputTextarea rows="4" cols="30" id="histoireMaladie" value="#{dossierMedicalController.selected.histoireMaladie}" title="#{bundle.EditDossierMedicalTitle_histoireMaladie}" />

                        <p:outputLabel value="#{bundle.EditDossierMedicalLabel_conclusionClinique}" for="conclusionClinique" />
                        <p:inputTextarea rows="4" cols="30" id="conclusionClinique" value="#{dossierMedicalController.selected.conclusionClinique}" title="#{bundle.EditDossierMedicalTitle_conclusionClinique}" />

                        <p:outputLabel value="#{bundle.EditDossierMedicalLabel_idPersonne}" for="idPersonne" />
                        <p:selectOneMenu id="idPersonne" value="#{dossierMedicalController.selected.idPersonne}" required="true" requiredMessage="#{bundle.EditDossierMedicalRequiredMessage_idPersonne}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{personneController.items}"
                                           var="idPersonneItem"
                                           itemValue="#{idPersonneItem}"
                                           itemLabel="#{idPersonneItem.idPersonne.toString()}"
                                           />
                            <f:converter binding="#{personneConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{dossierMedicalController.save}" value="#{bundle.Save}" update="display,:DossierMedicalListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,DossierMedicalEditDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="DossierMedicalEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
